<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :model="t_quote" :rules="rules" label-width="100px" id="mvcfm">
      <el-button @click="gotoPage('/psi/supplychainmana/InventoryList?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>返回</el-button>
      <el-button @click="gotoPage(''+vueparams+'')" type='primary' size="mini">查看流程</el-button>
      <el-button @click="gotoPage(''+vueparams+'')" type='primary' size="mini">甘特图</el-button>
      <el-button @click="gotoPage('/psi/supplychainmana/inventoryStatementSupply?'+vueparams+'')" type='primary' size="mini">生成盘存报告</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 任务详情 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="24">
            <el-form-item label="盘存类别" prop="">
              {{t_quote.take_interval}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="盘存标题" prop="">
              {{t_quote.quote_name}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="价格大于" prop="">
              {{t_quote.take_gprice}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="盘存开始时间" prop="">
              {{t_quote.take_begin_date}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="盘存要求时间" prop="">
              {{t_quote.take_ask_date}}
            </el-form-item>
          </el-col>
          <el-col :span="12"> 小时 </el-form-item>
          </el-col>
        </el-row>
      </div>
      <div class="form-unit">
        <span class="mvc-title-left"> 盘存任务步骤 </span>
      </div>
      <el-table :data="s_step">
        <el-table-column label="操作" align="center" width='100' type=''>
          <template slot-scope="scope">
            <el-dropdown trigger="click">
              <span class="el-dropdown-link">操作<i class="el-icon-arrow-down el-icon--right"></i></span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>
                  <el-link @click="gotoPage('/psi/supplychainmana/InventoryImp?CMIDcstep_id='+scope.row.cstep_id+''+vueparams+'')">盘存执行</el-link>
                </el-dropdown-item>
                <el-dropdown-item>
                  <el-link @click="gotoPage('/psi/supplychainmana/DiffRep?CMIDcstep_id='+scope.row.cstep_id+''+vueparams+'')">差异报告</el-link>
                </el-dropdown-item>
                <el-dropdown-item>
                  <el-link @click="gotoPage('/psi/supplychainmana/InventoryLibDiff?CMIDcstep_id='+scope.row.cstep_id+''+vueparams+'')">库管员差异处理</el-link>
                </el-dropdown-item>
                <el-dropdown-item>
                  <el-link @click="gotoPage('/psi/supplychainmana/InventoryLeaProHab?CMIDcstep_id='+scope.row.cstep_id+''+vueparams+'')">库管组长处理</el-link>
                </el-dropdown-item>
                <el-dropdown-item>
                  <el-link @click="gotoPage('/psi/supplychainmana/FinManApr?CMIDcstep_id='+scope.row.cstep_id+''+vueparams+'')">财务经理审批</el-link>
                </el-dropdown-item>
                <el-dropdown-item>
                  <el-link @click="gotoPage('/psi/supplychainmana/AccoutTrea?CMIDcstep_id='+scope.row.cstep_id+''+vueparams+'')">成本会计处理</el-link>
                </el-dropdown-item>
                <el-dropdown-item>
                  <el-link @click="gotoPage('/psi/supplychainmana/FinManConfirm?CMIDcstep_id='+scope.row.cstep_id+''+vueparams+'')">财务经理确认</el-link>
                </el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column>
        <el-table-column label="任务步骤" prop="step_name">
          {{scope.row.step_name}}
        </el-table-column>
        <el-table-column label="执行人" prop="contact_name">
        </el-table-column>
        <el-table-column label="开始时间" prop="begin_date">
          <template slot-scope="scope">
            {{getDateTimeString(scope.row,'begin_date')}}
          </template>
        </el-table-column>
        <el-table-column label="要求时间" prop="ask_date">
        </el-table-column>
        <el-table-column label="完成时间" prop="finish_date">
          <template slot-scope="scope">
            {{getDateTimeString(scope.row,'finish_date')}}
          </template>
        </el-table-column>
        <el-table-column label="任务状态" prop="cstep_state">
        </el-table-column>
      </el-table>
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'InventoryDet',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        t_quote: {
          take_interval: null,
          quote_name: null,
          take_gprice: null,
          take_begin_date: null,
          take_ask_date: null,
        },
        s_step: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/main/InventoryAction/inventoryDet?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      inventoryDetSubmit(_params) {
        request({
          method: 'post',
          url: '/xcapi/VUEAction/psi/main/InventoryAction/inventoryDetSubmit?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.gotoPage("/psi/supplychainmana/InventoryList/inventoryList?" + this.vueparams, data);
          this.msgSuccess(data.msg);
        })
      },
    },
  }
</script>
